package com.bjpowernode.service.impl;

import com.bjpowernode.common.constant.Constant;
import com.bjpowernode.entity.TCustomerRemark;
import com.bjpowernode.mapper.TCustomerMapper;
import com.bjpowernode.mapper.TCustomerRemarkMapper;
import com.bjpowernode.service.CustomerRemarkService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
@Slf4j
public class CustomerRemarkServiceImpl implements CustomerRemarkService {

    private final TCustomerRemarkMapper customerRemarkMapper;

    @Override
    public PageInfo<TCustomerRemark> getCustomerRemarkByPage(Integer current, Integer customerId) {
        PageHelper.startPage(current, Constant.PAGE_SIZE);
        List<TCustomerRemark> customerRemarks = customerRemarkMapper.getCustomerRemarkByPage(customerId);
        log.info(customerRemarks.toString());
        return new PageInfo<>(customerRemarks);
    }
}
